<?php
/*
 * Created on 23-Apr-09
 * Author Ankur Saxena
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
 class DBConnection{
 	var $server = 'localhost';
 	var $user = 'root';
 	var $pass = 'ankur234';
 	var $dbname = 'tnotes';
 	var $link ;
 	
 	function getNewConnection(){
 		$this->link = mysql_connect($this->server, $this->user, $this->pass);
 		if(!$this->link){
 			die('error: ' . mysql_error());
 		}
 		mysql_select_db($this->dbname, $this->link) ;
 		return $this->link;
 	}
 	
 	function getConnection(){
 		return $this->link;
 	}
 	
 	function execute_query($query){
 		$result = mysql_query($query);
 		return $result;
 	}
 	
 	function close(){
 		mysql_close($this->link);
 	}
 }
?>
